<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
	<title>TravelDream</title>
	<link rel="stylesheet" type="text/css" href="../style/prodottobase.css" />
</h:head>
<h:body>
<div id="main">
		<div id="upper">
			<div id="logo"><a href="/TravelDreamWeb/home.jsf"><img id="logo-img" src="../img/logo.png"/></a></div>
			<div id="login-up">Benvenuto, #{utenteBean.name} <br />
				<h:form><p:commandButton action="#{logoutBean.logout()}" value="Logout" />
				<h:link outcome="PaginaDatiPersonali" value="Modifica dati personali" /></h:form>
			</div>
		</div>
		<div id="center">
		<div id="center1">
			<p:outputLabel value="Pacchetti viaggio: " /><br/>
			<h:form id="form">			
				<p:dataTable style="width:600px" id="pacchettoPanel" value="#{pacchettoViaggioBean.listaPacchetti}" var="pacchetto" emptyMessage="Nessun pacchetto viaggio inserito."
					paginator="true" rows="10"  
        			paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
        			rowsPerPageTemplate="5,10,15"> 
					<p:column headerText="Nome" >
						<h:outputText value="#{pacchetto.nome}" />
					</p:column>
					<p:column headerText="Destinazione">
						<h:outputText value="#{pacchetto.destinazione}" />
					</p:column>
					<p:column style="width:90px">
						<p:commandButton value="Visualizza info" action="#{pacchettoViaggioBean.goToInfoPacc(pacchetto.idPacchettoViaggio)}" />
					</p:column>	
					<p:column style="width:90px">
						<p:commandButton value="Elimina" action="#{pacchettoViaggioBean.elimina(pacchetto.idPacchettoViaggio)}"/>
					</p:column>	
				</p:dataTable> 
			</h:form>
		</div></div>
		<div id="footer">
			<h:link outcome="PaginaPrincipale" value="Torna alla pagina principale" />
		</div>
	</div>
</h:body>
</html>